Ubuntu 12.04
Sponsored Link

OpenStack Havana - Set Floating IP
2013/11/22
 
It's possible to access to Virtual machine Instance to set Floating IP address.
[1] Change Nova's setting first to assign Floating IP address automatically.
root@dlp ~(keystone)#
vi /etc/nova/nova.conf
# add at the last

auto_assign_floating_ip=True
root@dlp ~(keystone)#
service nova-network restart

nova-network stop/waiting
nova-network start/running, process 3565
[2] Set Floating IP address. For exmaple, assign 10.0.0.248/29 for Floating IP addresses in internal network 10.0.0.0/24.
root@dlp ~(keystone)#
nova-manage floating create --ip_range=10.0.0.248/29

root@dlp ~(keystone)#
nova-manage floating list

None    10.0.0.249      None    nova    eth0
None    10.0.0.250      None    nova    eth0
None    10.0.0.251      None    nova    eth0
None    10.0.0.252      None    nova    eth0
None    10.0.0.253      None    nova    eth0
None    10.0.0.254      None    nova    eth0
[3] Create a new instance and boot it, then Floating IP is assgined automatically like follows. In the example below, The "10.0.0.249" is just the Floating IP.
# create and boot Instance

root@dlp ~(keystone)#
nova boot --flavor 2 --image Ubuntu13.10 --security_group default Ubuntu13.10_Pub

root@dlp ~(keystone)#
nova list

+------------+-----------------+---------+------------+-------------+--------------------------------+
| ID         | Name            | Status  | Task State | Power State | Networks                       |
+------------+-----------------+---------+------------+-------------+--------------------------------+
| a5c94eae-b | Ubuntu13.10_Pub | ACTIVE  | None       | Running     | network01=10.1.0.3, 10.0.0.249 |
| e4eddb40-a | Ubuntu_Saucy    | SHUTOFF | None       | Shutdown    | network01=10.1.0.2             |
+------------+-----------------+---------+------------+-------------+--------------------------------+
[4] The Instances created before setting Floating IP, Floating IP does not assigned automatically, so it necessarry to set it manually like follows.
root@dlp ~(keystone)#
nova list

+------------+-----------------+---------+------------+-------------+--------------------------------+
| ID         | Name            | Status  | Task State | Power State | Networks                       |
+------------+-----------------+---------+------------+-------------+--------------------------------+
| a5c94eae-b | Ubuntu13.10_Pub | ACTIVE  | None       | Running     | network01=10.1.0.3, 10.0.0.249 |
| e4eddb40-a | Ubuntu_Saucy    | SHUTOFF | None       | Shutdown    | network01=10.1.0.2             |
+------------+-----------------+---------+------------+-------------+--------------------------------+

# assign "10.0.0.250" to "Ubuntu_Saucy"

root@dlp ~(keystone)#
nova add-floating-ip Ubuntu_Saucy 10.0.0.250

root@dlp ~(keystone)#
nova list

+------------+-----------------+---------+------------+-------------+--------------------------------+
| ID         | Name            | Status  | Task State | Power State | Networks                       |
+------------+-----------------+---------+------------+-------------+--------------------------------+
| a5c94eae-b | Ubuntu13.10_Pub | ACTIVE  | None       | Running     | network01=10.1.0.3, 10.0.0.249 |
| e4eddb40-a | Ubuntu_Saucy    | SHUTOFF | None       | Shutdown    | network01=10.1.0.2, 10.0.0.250 |
+------------+-----------------+---------+------------+-------------+--------------------------------+
 
Tweet